package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;

@Setter
@Getter
public class CourseOrder {
    private Long id;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputTime;

    //客户
    private Customer customer;
    //课程
    private ClassInfo classinfo;

    //销售金额
    private BigDecimal money;


    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("customerId",customer.getId());
        map.put("classinfoId",classinfo.getId());
        map.put("money",money);

        return JSON.toJSONString(map);
    }

}